/*
# File    :   fsm_demo.c
# Author  :   SCHIPS
# Mail    :   schips@dingtalk.com
# Git     :   https://gitee.com/schips/
# Date    :   Mon, May 50, 2019  13:14:52 PM  ♡
*/

#include <stdio.h>
#include "fsm.h"
#include "fsm_app.h"
int main(void)
{
    int i = 10;
    SM_ARG var = {0};
    SM_DATA data={0};   
    config_sm_entry(&var, steps_list);
    config_data_entry(&var, &data);
    init_state_machine(&var);
    while(i--)
    {
        printf("cs = %d, ns = %d\n",var.st.cs,var.st.ns);

        run_state_machine_once(&var);

        // 停止条件
        if(is_sm_done(&var))
        {
            printf("Done\n");
            reset_state_machine(&var);
            //break;
        }
    }
    return 0;
}
